cmake_minimum_required(VERSION 3.20)
project(xlog)
include_directories("xlog")
#cmakelists.txt路径
message(${CMAKE_CURRENT_LIST_DIR})
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib") #这个只适用于linux，在windows上面没有生效，这个时候生成的路径在build/lib目录下面
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/lib")
#执行程序和dll输出路径
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/bin")
#归档输出路径静态库.lib 动态库.lib地址文件 linux静态库.a
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/lib")
#添加xlog库编译 项目自带预处理变量 xlog_EXPORTS
#add_library(xlog SHARED xlog/xlog.cpp)
# set(BUILD_SHARED_LIBS OFF)
# add_definitions(-Dxlog_STATIC)
set(BUILD_SHARED_LIBS ON) #动态库
add_subdirectory("xlog" )
add_subdirectory("test_log" )
# add_library(xlog xlog/xlog.cpp)
# add_executable(testXlog testXlog/testXlog.cpp)
# target_link_libraries(testXlog xlog)

